/**
 * Copyright &copy; 2015-2020 <a href="http://www.easyhis.com/">easyhis</a> All rights reserved.
 */
package com.easy.dfcapi.entity;

import javax.validation.constraints.NotNull;
import com.easy.modules.sys.entity.User;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.easy.core.persistence.DataEntity;
import com.easy.common.utils.excel.annotation.ExcelField;

/**
 * 订单表Entity
 * @author waylen chi
 * @version 2018-01-17
 */
public class ApiOrder extends DataEntity<ApiOrder> {
	
	private static final long serialVersionUID = 1L;
	private Integer orderId;		// order_id
	private String orderSn;		// 订单编号，唯一
	private String id;		// 订单UUID,对外传输
	private String bmerged;		// 0—本单为独立订单，1—合并订单
	private User u;		// 用户id,同dfc_user的user_id
	private Integer storeId;		// 商铺id,同dfc_store的store_id
	private Date orderDate;		// 订单时间
	private String orderStatus;		// 订单的状态;0未确认,1确认,2已取消,3无效,4退货
	private String deliverStatus;		// 商品配送情况;0未发货,1已发货,2已收货,4退货
	private String payStatus;		// 支付状态;0未付款;1—已付定金 2—诚信赊 3—付款确认
	private String consignee;		// 收货人的姓名,用户页面填写,默认取值表user_address
	private Integer country;		// 收货人的国家,用户页面填写,默认取值于表user_address, 其id对应的值在dfc_area
	private Integer province;		// 收货人的省份,用户页面填写,默认取值于表user_address, 其id对应的值在dfc_area
	private Integer city;		// 收货人的城市,用户页面填写,默认取值于表user_address,其id对应的值在dfc_area
	private Integer district;		// 收货人的地区,用户页面填写,默认取值于表user_address,其id对应的值在dfc_area
	private String address;		// 收货人的详细地址,用户页面填写,默认取值于表user_address
	private String zip;		// 收货人的邮编,用户页面填写,默认取值于表user_address
	private String phone;		// 收货人的电话,用户页面填写,默认取值于表user_address
	private String mobile;		// 收货人的手机,用户页面填写,默认取值于表user_address
	private String email;		// 收货人的Email, 用户页面填写,默认取值于表user_address
	private String bestTime;		// 收货人的最佳送货时间,用户页面填写,默认取值于表user_addr
	private String signBuilding;		// 送货人的地址的标志性建筑,用户页面填写,默认取值于表user_address
	private String postScript;		// 订单附言,由用户提交订单前填写
	private Integer payId;		// 用户选择的支付方式的id
	private Integer howOos;		// 缺货处理方式,等待所有商品备齐后再发,取消订单;与店主协商
	private Integer invPayee;		// 发票抬头,用户页面填写
	private Integer invContent;		// 发票内容
	private Integer deliverType;		// 约定发货时间，默认2（24小时内)
	private String deliverDesc;		// 自定义发货时间
	private Integer deliverId;		// 用户选择的配送方式id
	private Integer creditType;		// 赊欠账期，默认2（60天）
	private String creditDesc;		// 自定义赊欠账期
	
	public ApiOrder() {
		super();
	}

	public ApiOrder(String id){
		this.id = id;
	}

	@NotNull(message="order_id不能为空")
	@ExcelField(title="order_id", align=2, sort=0)
	public Integer getOrderId() {
		return orderId;
	}

	public void setOrderId(Integer orderId) {
		this.orderId = orderId;
	}
	
	@ExcelField(title="订单编号，唯一", align=2, sort=1)
	public String getOrderSn() {
		return orderSn;
	}

	public void setOrderSn(String orderSn) {
		this.orderSn = orderSn;
	}
	
	@ExcelField(title="订单UUID,对外传输", align=2, sort=2)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	@ExcelField(title="0—本单为独立订单，1—合并订单", align=2, sort=3)
	public String getBmerged() {
		return bmerged;
	}

	public void setBmerged(String bmerged) {
		this.bmerged = bmerged;
	}
	
	@ExcelField(title="用户id,同dfc_user的user_id", fieldType=User.class, value="u.userName", align=2, sort=4)
	public User getU() {
		return u;
	}

	public void setU(User u) {
		this.u = u;
	}
	
	@ExcelField(title="商铺id,同dfc_store的store_id", align=2, sort=5)
	public Integer getStoreId() {
		return storeId;
	}

	public void setStoreId(Integer storeId) {
		this.storeId = storeId;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="订单时间", align=2, sort=6)
	public Date getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}
	
	@ExcelField(title="订单的状态;0未确认,1确认,2已取消,3无效,4退货", align=2, sort=7)
	public String getOrderStatus() {
		return orderStatus;
	}

	public void setOrderStatus(String orderStatus) {
		this.orderStatus = orderStatus;
	}
	
	@ExcelField(title="商品配送情况;0未发货,1已发货,2已收货,4退货", align=2, sort=8)
	public String getDeliverStatus() {
		return deliverStatus;
	}

	public void setDeliverStatus(String deliverStatus) {
		this.deliverStatus = deliverStatus;
	}
	
	@ExcelField(title="支付状态;0未付款;1—已付定金 2—诚信赊 3—付款确认", align=2, sort=9)
	public String getPayStatus() {
		return payStatus;
	}

	public void setPayStatus(String payStatus) {
		this.payStatus = payStatus;
	}
	
	@ExcelField(title="收货人的姓名,用户页面填写,默认取值表user_address", align=2, sort=10)
	public String getConsignee() {
		return consignee;
	}

	public void setConsignee(String consignee) {
		this.consignee = consignee;
	}
	
	@ExcelField(title="收货人的国家,用户页面填写,默认取值于表user_address, 其id对应的值在dfc_area", align=2, sort=11)
	public Integer getCountry() {
		return country;
	}

	public void setCountry(Integer country) {
		this.country = country;
	}
	
	@ExcelField(title="收货人的省份,用户页面填写,默认取值于表user_address, 其id对应的值在dfc_area", align=2, sort=12)
	public Integer getProvince() {
		return province;
	}

	public void setProvince(Integer province) {
		this.province = province;
	}
	
	@ExcelField(title="收货人的城市,用户页面填写,默认取值于表user_address,其id对应的值在dfc_area", align=2, sort=13)
	public Integer getCity() {
		return city;
	}

	public void setCity(Integer city) {
		this.city = city;
	}
	
	@ExcelField(title="收货人的地区,用户页面填写,默认取值于表user_address,其id对应的值在dfc_area", align=2, sort=14)
	public Integer getDistrict() {
		return district;
	}

	public void setDistrict(Integer district) {
		this.district = district;
	}
	
	@ExcelField(title="收货人的详细地址,用户页面填写,默认取值于表user_address", align=2, sort=15)
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	@ExcelField(title="收货人的邮编,用户页面填写,默认取值于表user_address", align=2, sort=16)
	public String getZip() {
		return zip;
	}

	public void setZip(String zip) {
		this.zip = zip;
	}
	
	@ExcelField(title="收货人的电话,用户页面填写,默认取值于表user_address", align=2, sort=17)
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@ExcelField(title="收货人的手机,用户页面填写,默认取值于表user_address", align=2, sort=18)
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	@ExcelField(title="收货人的Email, 用户页面填写,默认取值于表user_address", align=2, sort=19)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	
	@ExcelField(title="收货人的最佳送货时间,用户页面填写,默认取值于表user_addr", align=2, sort=20)
	public String getBestTime() {
		return bestTime;
	}

	public void setBestTime(String bestTime) {
		this.bestTime = bestTime;
	}
	
	@ExcelField(title="送货人的地址的标志性建筑,用户页面填写,默认取值于表user_address", align=2, sort=21)
	public String getSignBuilding() {
		return signBuilding;
	}

	public void setSignBuilding(String signBuilding) {
		this.signBuilding = signBuilding;
	}
	
	@ExcelField(title="订单附言,由用户提交订单前填写", align=2, sort=22)
	public String getPostScript() {
		return postScript;
	}

	public void setPostScript(String postScript) {
		this.postScript = postScript;
	}
	
	@ExcelField(title="用户选择的支付方式的id", align=2, sort=23)
	public Integer getPayId() {
		return payId;
	}

	public void setPayId(Integer payId) {
		this.payId = payId;
	}
	
	@ExcelField(title="缺货处理方式,等待所有商品备齐后再发,取消订单;与店主协商", align=2, sort=24)
	public Integer getHowOos() {
		return howOos;
	}

	public void setHowOos(Integer howOos) {
		this.howOos = howOos;
	}
	
	@ExcelField(title="发票抬头,用户页面填写", align=2, sort=25)
	public Integer getInvPayee() {
		return invPayee;
	}

	public void setInvPayee(Integer invPayee) {
		this.invPayee = invPayee;
	}
	
	@ExcelField(title="发票内容", align=2, sort=26)
	public Integer getInvContent() {
		return invContent;
	}

	public void setInvContent(Integer invContent) {
		this.invContent = invContent;
	}
	
	@ExcelField(title="约定发货时间，默认2（24小时内)", align=2, sort=27)
	public Integer getDeliverType() {
		return deliverType;
	}

	public void setDeliverType(Integer deliverType) {
		this.deliverType = deliverType;
	}
	
	@ExcelField(title="自定义发货时间", align=2, sort=28)
	public String getDeliverDesc() {
		return deliverDesc;
	}

	public void setDeliverDesc(String deliverDesc) {
		this.deliverDesc = deliverDesc;
	}
	
	@ExcelField(title="用户选择的配送方式id", align=2, sort=29)
	public Integer getDeliverId() {
		return deliverId;
	}

	public void setDeliverId(Integer deliverId) {
		this.deliverId = deliverId;
	}
	
	@ExcelField(title="赊欠账期，默认2（60天）", align=2, sort=30)
	public Integer getCreditType() {
		return creditType;
	}

	public void setCreditType(Integer creditType) {
		this.creditType = creditType;
	}
	
	@ExcelField(title="自定义赊欠账期", align=2, sort=31)
	public String getCreditDesc() {
		return creditDesc;
	}

	public void setCreditDesc(String creditDesc) {
		this.creditDesc = creditDesc;
	}
	
}